Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

presenting the Oscar winning welcome page #894

Merged
merged 4 commits into from
Dec 12, 2018
Merged

presenting the Oscar winning welcome page #894

merged 4 commits into from
Dec 12, 2018

Conversation

cezaraugusto
Copy link
Contributor

closes brave/brave-browser#1847

npm run test-unit should cover edge cases of welcome page
brave://welcome for manual testing

oscar

all props to @rossmoody I just did the code

@bbondy
Copy link
Member

bbondy commented Dec 2, 2018

@cezaraugusto ping on this since this is 22 days old

Copy link
Member

@petemill petemill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very cool!

Left some comments, mainly nits and some tiny cleanup.

One thing would be great to do is move the images from brave-core/components/img to as local to where they are used as possible, continuing with out as much as possible self-containing component architecture. e.g. if the asset is imported in brave_welcome_ui/components/screens, lets put the images there. If it's actually needed by a brave-ui component and it never changes (e.g. <ShieldsImage />), then we can leave the assets in brave-ui and we don't need the additional complication of passing the url down as a prop. The other thing is that we don't need to specify the generated image names and paths in c++ - webpack will put the files in the right place, and the build will pick them up and make sure they are served at runtime.
If you do change these, please use import myUrl from 'my.svg' syntax instead of require. It's good for us to consistently use es-module style instead of nodejs style for webpack which only supports tree shaking and code splitting using es module syntax.
If you don't, please at least remove the image definitions from the GRD and c++.

Have the SVG graphics been optimized with svgo(mg)? It's probably yes because these are complicated images so that may be why they are still big, so just checking... If not, please do.

Second, a UX point: when experiencing this page for the first time, I wonder if the transitions feel pretty slow. The brave logo hovering timing seems perfect. The initial fade-in seems maybe a little slow and the slide animation feels very slow. We've got the slide animation at around 2.5s. Various research I've read in the past suggests micro-transitions should be around 250ms or less and more general page transitions like this could be double that and at least < 1s. Should easing be ease-in-out (or some variant) since content is both exiting and entering. I think we have that set to ease-out.
If you and @rossmoody don't feel that this needs to be changed then ok. If you want to adjust this in brave-ui before pushing this PR, then go for it. If you want to do it later or want someone else to do it, then we can merge this as long as @rossmoody is happy with the timings as they are potentially going in to a Release.

{ "59ec9e5cdea1df1630f8c6e2b7a27ede.png", IDR_BRAVE_WELCOME_SLIDE_4_IMAGE },
{ "c2217e15737be3c82f5fef818d3fd26c.png", IDR_BRAVE_WELCOME_SLIDE_5_IMAGE },
{ "e9d936c617aad55fe1bc7a001f2defb4.svg", IDR_BRAVE_WELCOME_BACKGROUND_IMAGE }
{ "9e31ed86a2f12b6d4a22041f62ed412e.svg", IDR_BRAVE_WELCOME_SLIDE_1_IMAGE },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These images don't need to be specified here, they will be automatically included if generated via webpack build

get actions () {
return this.props.actions
get totalScreensSize () {
return 6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this can be a const variable in the module, instead of a function, since it does not change

default:
return <BraveScreen onGoToFirstSlide={this.onGoToFirstSlide} />
}
get backgroundPosition () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not seem to be called from anywhere - can be removed


// Utils
import * as welcomeActions from '../actions/welcome_actions'

// Assets
const background = require('../../img/welcome/welcomebg.svg')
const background = require('../../img/welcome/welcome_bg.svg')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the webpack loaders will return a URL string for asset file imports, so a more readable name IMO would be backgroundUrl in these cases


// Shared components
import { ArrowRightIcon } from 'brave-ui/components/icons'
import { Button } from 'brave-ui/components'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use import { Button } from 'brave-ui' for consistency in order to preserve tree shaking. At least the important thing is to be consistent within a brave-core webui, so if you want to leave it as this for all of them, then that should be technically ok.

import { Content, Title, ThemeImage, Paragraph } from 'brave-ui/features/welcome/'

// Shared components
import { Button } from 'brave-ui/components'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove /components to be consistent

@@ -0,0 +1,164 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 325 200">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this been optimized with svgo(mg)? It's probably yes because these are complicated images so that may be why they are still big, so just checking...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can speak to this one cause i did it. these were run through svgo but they are pretty serious svgs. quite a few elements with linear gradients in each.

<include name="IDR_BRAVE_WELCOME_SLIDE_4_IMAGE" file="../img/welcome/rewards.png" type="BINDATA" />
<include name="IDR_BRAVE_WELCOME_SLIDE_5_IMAGE" file="../img/welcome/shields.png" type="BINDATA" />
<include name="IDR_BRAVE_WELCOME_BACKGROUND_IMAGE" file="../img/welcome/welcomebg.svg" type="BINDATA" />
<include name="IDR_BRAVE_WELCOME_SLIDE_1_IMAGE" file="../img/welcome/lion_logo.svg" type="BINDATA" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These don't need to be specified if they are imported via webpack, and from what I can tell, they are.

<message name="IDS_BRAVE_WELCOME_PAGE_MAIN_BUTTON" desc="Button that moves to the next welcome screen">Let's go</message>
<message name="IDS_BRAVE_WELCOME_PAGE_REWARDS_TITLE" desc="Welcome message title for Brave Rewards">Enable Brave Rewards</message>
<message name="IDS_BRAVE_WELCOME_PAGE_REWARDS_DESC" desc="Explainer text about Brave Rewards">Brave Rewards is a new way of thinking about how the web works. Get rewarded for viewing privacy-respecting ads, and support your favorite content creators while you’re at it.</message>
<message name="IDS_BRAVE_WELCOME_PAGE_REWARDS_DESC" desc="Explainer text about Brave Rewards">Your attention is valuable. Earn by viewing privacy-respecting ads while you browse, and pay it forward to support content creators you love.</message>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting in good descs 👍

@rossmoody
Copy link
Contributor

@cezaraugusto Per animation notes: The initial hope was to give the user a few seconds to adjust (since technically this would be the first time opening Brave) and also the panels are pretty big but I think I'd prefer to be a little fast than a little slow and we can always fine tune after this. Could you adjust the transition timing for the panels and the initial reveal to 400ms? We can keep the ease designations the same.

Copy link
Member

@petemill petemill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for making the changes 🎆

@petemill petemill merged commit 208606f into master Dec 12, 2018
@petemill petemill deleted the welcome-v2 branch December 12, 2018 17:58
petemill added a commit that referenced this pull request Dec 12, 2018
presenting the Oscar winning welcome page
@petemill
Copy link
Member

0.60.x 4bf00c4

@petemill
Copy link
Member

@rebron @kjozwiak @srirambv uplift request for 59 (or 58)

@cezaraugusto
Copy link
Contributor Author

@kjozwiak
Copy link
Member

@petemill uplift request to 0.59.x beta approved 👍 Please add/remove all needed labels and ensure that the associated issue is moved to the correct milestone.

cezaraugusto pushed a commit that referenced this pull request Dec 19, 2018
presenting the Oscar winning welcome page
@cezaraugusto
Copy link
Contributor Author

0.59.x cb0fd9b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updates to welcome flow to fix multiple issues
5 participants